package ThreadDemo;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 34255
 * Date: 2024-10-10
 * Time: 17:40
 */
public class Demo7 {
    public static void main(String[] args) {
        
        Thread thread = new Thread(() -> {
            while(true){
                System.out.println("hello Thread");
                try {
                    Thread .sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        },"thread_01");

//        thread.setDaemon(true);
        thread.start();

        for (int i = 0; i < 3; i++) {
//            System.out.println(thread.getId());
//            System.out.println(thread.getName());
            System.out.println(thread.isDaemon());
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
